package provider

type DefaultMachineIdProvider struct {
	MachineId int64
}
func (mp DefaultMachineIdProvider) GenMachineId() int64  {
	return mp.MachineId
}



type DefaultMachineIdsProvider struct {
	MachineIds [] int64
	currentIndex int
}
func (mp *DefaultMachineIdsProvider) GenMachineId() int64  {
	index := mp.currentIndex
	mp.currentIndex++
	mp.currentIndex = mp.currentIndex % len(mp.MachineIds)
	return mp.MachineIds[index]
}

func NewDefaultMachineIdProvider(id int64) MachineIdProvider  {
	println("create machine id provider")
	return &DefaultMachineIdProvider{MachineId: id,}
}

func NewDefaultMachineIdsProvider(ids []int64) MachineIdProvider  {
	println("create machine id provider")
	return &DefaultMachineIdsProvider{MachineIds: ids,}
}